<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>汽车对象</title>
	</head>
	<body>
		<h1>保时捷718 Cayman T，红色，641000元</h1>
		<script>
			//js定义对象
			var car = new Object();//标准写法
			var car = {
				speed:300,
				warranty:10,
				toString:function(){
					return this.speed+","+this.warranty;
				}
			};
			// 定义属性（动态添加属性）
			car.name = "保时捷718";
			car.type = "Cayman T";
			car.color = "红色";
			car.price = 641000;
			console.log(car);
			car.show = function(){
				return this.name+","+this.type+","+this.color+","+this.price;
			}
			console.log(car.show());
		</script>
	</body>
</html>
